package com.team.runsfast.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@TableName("t_cart")
@NoArgsConstructor
public class Cart {
    /**购物车ID*/
    @TableId(type = IdType.AUTO)
    private Long id;
    /**对应用户ID*/
    private Long uid;
    /**购物车中的商品ID*/
    private Long fid;
    /**购物车的数量(一种商品可以买多个 一种商品算作一个购物车)*/
    private Integer num;
    /**加入购物车时价格*/
    private Double joinprice;
    /**创建时间*/
    private Date ctime;

    public Cart(Long uid, Long fid, Integer num, Double joinprice) {
        this.uid = uid;
        this.fid = fid;
        this.num = num;
        this.joinprice = joinprice;
        this.ctime=new Date();
    }
}